cd "$(dirname $0)"

container='sphinx'
image_name='m986883511/sphinx:all'
dockerfile='Dockerfile'

docker stop $container
docker rm $container

docker build -f $dockerfile -t $image_name .
if [ $? -eq 0 ];then
  echo "docker build $image_name success"
else
  echo "docker build $image_name failed"
  exit 1
fi

echo ">>> docker run --rm -it  --name $container $image_name bash"
echo ">>> docker push $image_name"
